import 'package:FiduMart/generated/json/base/json_convert_content.dart';
import 'package:FiduMart/core/network/model/ticker_currencytoppair_entity.dart';

TickerCurrencytoppairEntity $TickerCurrencytoppairEntityFromJson(
    Map<String, dynamic> json) {
  final TickerCurrencytoppairEntity tickerCurrencytoppairEntity = TickerCurrencytoppairEntity();
  final String? marketId = jsonConvert.convert<String>(json['market_id']);
  if (marketId != null) {
    tickerCurrencytoppairEntity.marketId = marketId;
  }
  final String? marketName = jsonConvert.convert<String>(json['market_name']);
  if (marketName != null) {
    tickerCurrencytoppairEntity.marketName = marketName;
  }
  final double? id = jsonConvert.convert<double>(json['id']);
  if (id != null) {
    tickerCurrencytoppairEntity.id = id;
  }
  final String? pair = jsonConvert.convert<String>(json['pair']);
  if (pair != null) {
    tickerCurrencytoppairEntity.pair = pair;
  }
  return tickerCurrencytoppairEntity;
}

Map<String, dynamic> $TickerCurrencytoppairEntityToJson(
    TickerCurrencytoppairEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['market_id'] = entity.marketId;
  data['market_name'] = entity.marketName;
  data['id'] = entity.id;
  data['pair'] = entity.pair;
  return data;
}

extension TickerCurrencytoppairEntityExt on TickerCurrencytoppairEntity {
  TickerCurrencytoppairEntity copyWith({
    String? marketId,
    String? marketName,
    double? id,
    String? pair,
  }) {
    return TickerCurrencytoppairEntity()
      ..marketId = marketId ?? this.marketId
      ..marketName = marketName ?? this.marketName
      ..id = id ?? this.id
      ..pair = pair ?? this.pair;
  }
}